import java.awt.*;
import java.awt.event.KeyEvent;

/**
 * Created by tpeng on 2016/4/2.
 */
public class Roboot {

        public Robot robot = null;

        public Roboot() {
            try {
                robot = new Robot();
            } catch (AWTException e) {
                e.printStackTrace();
            }
        }

    public static void main(String[] args) throws Exception{

        for (int i =0; i<10000; i++) {

            Roboot mrbot = new Roboot();

            mrbot.robot.mouseMove(338, 57);
            mrbot.robot.mousePress(KeyEvent.BUTTON1_MASK);
            mrbot.robot.mouseRelease(KeyEvent.BUTTON1_MASK);

            mrbot.robot.keyPress(KeyEvent.VK_ALT);
            mrbot.robot.keyPress(KeyEvent.VK_8);

            mrbot.robot.keyRelease(KeyEvent.VK_8);
            mrbot.robot.keyRelease(KeyEvent.VK_ALT);


            /*mrbot.robot.mouseMove(585, 30);
            mrbot.robot.mousePress(KeyEvent.BUTTON1_MASK);
            mrbot.robot.mouseRelease(KeyEvent.BUTTON1_MASK);

            mrbot.robot.keyPress(KeyEvent.VK_ALT);
            mrbot.robot.keyPress(KeyEvent.VK_8);

            mrbot.robot.keyRelease(KeyEvent.VK_8);
            mrbot.robot.keyRelease(KeyEvent.VK_ALT);

            mrbot.robot.mouseMove(320, 137);
            mrbot.robot.mousePress(KeyEvent.BUTTON1_MASK);
            mrbot.robot.mouseRelease(KeyEvent.BUTTON1_MASK);*/
            Thread.sleep(5000L);
        }

    }
}
